<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\modules\home\models\Link */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="link-form">

    <?php $form = ActiveForm::begin(); ?>
    <div class="row">
        <div class="col-md-6">
            <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

            <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>
            <?php if($model->isNewRecord){ ?>
                <?= $form->field($model, 'sort')->textInput(['value' => 0])->label('排序【 <span style="color:red">正整数数值越大越靠前</span> 】') ?>
            <?php }else{ ?>
                <?= $form->field($model, 'sort')->textInput()->label('排序【 正整数数值越大越靠前 】') ?>
            <?php }?>
            <div class="form-group">
                <?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
            </div>
        </div>
    </div>


    <?php ActiveForm::end(); ?>

</div>
